/* eslint-disable no-debugger */
/* eslint-disable no-shadow */
/**
 * 分页器组件
 * 组件描述：根据分页信息生成分页器，提供onChangePage回调。
 * @author LiAnqi
 * @Date 2022-03-01
 */

import { Pagination } from 'antd'
import PaginationProps from './PaginationProps.json'

function FCPagination(props) {
  const {
    pageSize,
    pageNum,
    total,
    showSizeChanger,
    showTitle,
    simple,
    onChangeNumChange,
    onShowSizeChange,
  } = props

  return (
    <Pagination
      showTitle={showTitle === undefined ? true : showTitle}
      simple={simple}
      current={pageNum}
      pageSize={pageSize}
      total={total}
      showSizeChanger={showSizeChanger}
      onChange={(page, thePageSize) => {
        onChangeNumChange(page, thePageSize)
      }}
      onShowSizeChange={(current, thePageSize) => {
        onShowSizeChange(current, thePageSize)
      }}
    />
  )
}

export default FCPagination
